﻿using System;
using Cesave.Domain.Core.Specification;
using Cesave.Domain.PermisosModule.Entities;

namespace Cesave.Domain.PermisosModule.Contracts.Juntas
{
	/// <summary>
	/// 
	/// </summary>
	public class JuntasByStatusSpecification
		: Specification<Junta>
	{

		#region Private properties

		/// <summary>
		/// 
		/// </summary>
		private bool _status = default(bool);

		#endregion

		#region Constructor

		/// <summary>
		/// 
		/// </summary>
		/// <param name="status"></param>
		public JuntasByStatusSpecification(bool status = true)
		{
			_status = status;
		}

		#endregion

		#region Specification overrides

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public override System.Linq.Expressions.Expression<Func<Junta, bool>> SatisfiedBy()
		{
			Specification<Junta> specification = new TrueSpecification<Junta>();
			specification &= new DirectSpecification<Junta>(junta => junta.Status == _status);
			return specification.SatisfiedBy();
		}

		#endregion

	}
}
